Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick](branch-21) reuse the join block to reduce malloc memory (#43738) #44349

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

zhangstar333
Copy link
Contributor

cherry-pick from master #43738

…43738)

Problem Summary:
before in the pull function, it's use tmp_block to reference data and
swap with output_block.
and then create empty column in join_block, so insert into data at next
time, it's need malloc memory again.

after fixed:
```
mysql [ssb]>set parallel_pipeline_task_num = 0;
mysql [ssb]>select count(c_custkey) from (select c_custkey from customer cross join dates)t;
+------------------+
| count(c_custkey) |
+------------------+
|       7668000000 |
+------------------+
1 row in set (0.32 sec)

mysql [ssb]>set parallel_pipeline_task_num = 1;
Query OK, 0 rows affected (0.00 sec)

mysql [ssb]>select count(c_custkey) from (select c_custkey from customer cross join dates)t;
+------------------+
| count(c_custkey) |
+------------------+
|       7668000000 |
+------------------+
1 row in set (5.61 sec)
```

before
```
mysql [ssb]>set parallel_pipeline_task_num = 0;
Query OK, 0 rows affected (0.00 sec)

mysql [ssb]>select count(c_custkey) from (select c_custkey from customer cross join dates)t;
+------------------+
| count(c_custkey) |
+------------------+
|       7668000000 |
+------------------+
1 row in set (2.79 sec)

mysql [ssb]>set parallel_pipeline_task_num = 1;
Query OK, 0 rows affected (0.00 sec)

mysql [ssb]>select count(c_custkey) from (select c_custkey from customer cross join dates)t;
+------------------+
| count(c_custkey) |
+------------------+
|       7668000000 |
+------------------+
1 row in set (10.21 sec)
```
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@zhangstar333
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.46% (9521/26113)
Line Coverage: 27.94% (78344/280429)
Region Coverage: 26.59% (40167/151064)
Branch Coverage: 23.39% (20402/87208)
Coverage Report: http://coverage.selectdb-in.cc/coverage/b05c789d723b7ce4682be8ef8ea02a45de3d088a_b05c789d723b7ce4682be8ef8ea02a45de3d088a/report/index.html

@yiguolei yiguolei merged commit 6678088 into apache:branch-2.1 Nov 22, 2024
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants